package cn.gson.boot.model.service;

import cn.gson.boot.model.dao.FaHuoDao;
import cn.gson.boot.model.dao.FaHuoXiangQinDao;
import cn.gson.boot.model.dao.KeFuDao;
import cn.gson.boot.model.mapper.FaHuoMapper;
import cn.gson.boot.model.mapper.FaHuoXiangQinMapper;
import cn.gson.boot.model.mapper.KeFuMapper;
import cn.gson.boot.model.pojos.Fahuo;
import cn.gson.boot.model.pojos.Fahuoxiangqing;
import cn.gson.boot.model.pojos.Kefu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class KeFuService {
    @Autowired
    KeFuDao keFuDao;
    @Autowired
    KeFuMapper keFuMapper;

    //新增客服
    public void addKeFu(Kefu kefu) {
        kefu.setKfYs(1);
        keFuDao.save(kefu);
    }

    //查询客服
    public List<Kefu> selectAllKeFu(String kName){
        return keFuMapper.selectAllKeFu(kName);
    }

    //移除客服
    public void yichuKeFu(Integer kfId) {
        keFuDao.yichuKeFu(kfId);
    }
}